package com.chengqs.rapid.disruptor.quicklystart;

import com.lmax.disruptor.EventHandler;
import org.apache.commons.lang3.RandomUtils;

/**
 * <B>主类名称：</B>OrderEventHandler<BR>
 * <B>概要说明：</B>事件<BR>
 *
 * @author: chengqs
 * @create: 2025-03-11 16:13:31
 **/
public class OrderEventHandler implements EventHandler<OrderEvent> {
    @Override
    public void onEvent(OrderEvent event, long sequence, boolean endOfBatch) throws Exception {
        Thread.sleep(RandomUtils.nextInt(1, 100));
        System.err.println("消费者消费：" + event.getValue() + " thread: " + Thread.currentThread().getName());
    }
}
